<template>
  <div>
    <div class="Logout">
      <Logout>退出</Logout>
    </div>
    <h1>查询家谱信息</h1>
    <el-form>
      <el-button @click="count" type="success" icon="el-icon-search">家谱信息展示</el-button>
    </el-form>
    <el-table  v-if="tableData"
               :data="tableData"
               border
               style="width: 100%">
      <template slot="empty" >
        <span style="font-size: 20px"></span>
      </template>
    
      <el-table-column
        prop="zno"
        label="家谱ID"
        width="120">
      </el-table-column>

      
        <el-table-column
        prop="zpartner"
        label="用户ID"
        width="120">
      </el-table-column>

    
      <el-table-column
        prop="zname"
        label="家谱名称"
        width="120">
      </el-table-column>



       <el-table-column
        prop="zbirth"
        label="内容描述"
        width="120">
      </el-table-column>

<!--     
        <el-table-column
        prop="zdie"
        label="家训"
        width="120">
      </el-table-column> -->
<!-- 
       <el-table-column
        prop="zmarry"
        label="族长"
        width="120">
      </el-table-column> -->

       

    
       <!-- <el-table-column
        prop="zchild"
        label="姓氏起源"
        width="120">
      </el-table-column> -->

<!--       
       <el-table-column
        prop="zlife"
        label="恩荣录"
        width="120">
      </el-table-column> -->
<!-- 
       <el-table-column
        prop="zaddress"
        label="族长联系方式"
        width="120">
      </el-table-column>  -->


       <el-table-column
        prop="zhonor"
        label="创建时间"
        width="120">
      </el-table-column>


       

    </el-table>
  </div>
</template>

<script>
import Logout from "./Logout";
export default {
  name: "FindZupu",
  components:{Logout},
  created() {
    let  _this = this;
    console.log("即将打印全体家族成员数量")
    this.$axios.post(`/ShowZupu`).then((res) => {
      console.log(res.data);
      this.tableData = res.data;
      this.sta = true
      console.log("全部数据：", this.tableData)
    })
  },
  methods:{
    count() {
      this.$axios.post(`/CountZupu`).then((res) => {
        console.log(res.data);
        this.counts = res.data;
        console.log("家族成员数量：", this.counts);
        if (res.data.msg=="返回家族成员数量成功") {
          alert("家族成员数量：" + res.data.data)
        }
      })
    }
  },

  data () {
    return {
      user:{
        zno:this.search_zno,
        zname:'',
     //   zlevel:'',
     //   zcharacter:'',
      },
      sta:false,
      search_zno:'',
      tableData: null,
      counts:'',
    }
  }
}
</script>

<style scoped>

</style>
